package com.ruoyi.hospital.service.operation.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.operation.OperationAgreementMapper;
import com.ruoyi.hospital.domain.operation.OperationAgreement;
import com.ruoyi.hospital.service.operation.IOperationAgreementService;

/**
 * 协议管理Service业务层处理
 * 
 * @author wendao
 * @date 2024-09-14
 */
@Service
public class OperationAgreementServiceImpl implements IOperationAgreementService 
{
    @Autowired
    private OperationAgreementMapper operationAgreementMapper;

    /**
     * 查询协议管理
     * 
     * @param id 协议管理主键
     * @return 协议管理
     */
    @Override
    public OperationAgreement selectOperationAgreementById(Integer id)
    {
        return operationAgreementMapper.selectOperationAgreementById(id);
    }

    /**
     * 查询协议管理列表
     * 
     * @param operationAgreement 协议管理
     * @return 协议管理
     */
    @Override
    public List<OperationAgreement> selectOperationAgreementList(OperationAgreement operationAgreement)
    {
        return operationAgreementMapper.selectOperationAgreementList(operationAgreement);
    }

    /**
     * 新增协议管理
     * 
     * @param operationAgreement 协议管理
     * @return 结果
     */
    @Override
    public int insertOperationAgreement(OperationAgreement operationAgreement)
    {
        operationAgreement.setCreateTime(DateUtils.getNowTimeSecond());
        return operationAgreementMapper.insertOperationAgreement(operationAgreement);
    }

    /**
     * 修改协议管理
     * 
     * @param operationAgreement 协议管理
     * @return 结果
     */
    @Override
    public int updateOperationAgreement(OperationAgreement operationAgreement)
    {
        operationAgreement.setUpdateTime(DateUtils.getNowTimeSecond());
        return operationAgreementMapper.updateOperationAgreement(operationAgreement);
    }

    /**
     * 批量删除协议管理
     * 
     * @param ids 需要删除的协议管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationAgreementByIds(Integer[] ids)
    {
        return operationAgreementMapper.deleteOperationAgreementByIds(ids);
    }

    /**
     * 删除协议管理信息
     * 
     * @param id 协议管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationAgreementById(Integer id)
    {
        return operationAgreementMapper.deleteOperationAgreementById(id);
    }
}
